Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Added GtkSeparator #73

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Gtk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export GtkWindow, GtkCanvas, GtkBox, GtkButtonBox, GtkPaned, GtkLayout, GtkNoteb
GtkImage, GtkProgressBar, GtkSpinner, GtkStatusbar, GtkStatusIcon,
GtkTextBuffer, GtkTextView, GtkTextMark, GtkTextTag,
GtkMenuItem, GtkSeparatorMenuItem, GtkMenu, GtkMenuBar, GtkAboutDialog, GtkDialog,
GtkFileChooserDialog, GtkMessageDialog, GtkNullContainer,
GtkFileChooserDialog, GtkMessageDialog, GtkSeparator, GtkNullContainer,
GtkBuilder, GtkListStore, GtkTreeStore,
GtkTreeIter, GtkTreeSelection, GtkTreeView, GtkTreeViewColumn,
GtkCellRendererAccel, GtkCellRendererCombo, GtkCellRendererPixbuf,
Expand Down Expand Up @@ -132,7 +132,7 @@ end
for container in subtypes(GtkContainerI,true)
@eval $(symbol(string(container)))(child::GtkWidgetI,vargs...) = push!($container(vargs...),child)
end
for orientable in tuple(:GtkPaned, :GtkScale, [sym.name.name for sym in subtypes(GtkBoxI,true)]...)
for orientable in tuple(:GtkPaned, :GtkScale, :GtkSeparator, [sym.name.name for sym in subtypes(GtkBoxI,true)]...)
@eval $orientable(orientation::Symbol,vargs...) = $orientable(
(orientation==:v ? true :
(orientation==:h ? false :
Expand Down Expand Up @@ -203,6 +203,7 @@ module ShortNames
const Pixbuf = GdkPixbuf
const Image = GtkImage
const ProgressBar = GtkProgressBar
const Separator = GtkSeparator
const Spinner = GtkSpinner
const Statusbar = GtkStatusbar
const StatusIcon = GtkStatusIcon
Expand Down Expand Up @@ -257,7 +258,7 @@ module ShortNames
Entry, Scale, Adjustment, SpinButton, ComboBoxText,
Pixbuf, Image, ProgressBar, Spinner, Statusbar,
StatusIcon, TextBuffer, TextView, TextMark, TextTag,
MenuItem, SeparatorMenuItem, Menu, MenuBar,
MenuItem, Separator, SeparatorMenuItem, Menu, MenuBar,
NullContainer, Key, Builder, ListStore,
TreeStore, TreeIter, TreeSelection, TreeView, TreeViewColumn,
CellRendererAccel, CellRendererCombo, CellRendererPixbuf,
Expand Down
10 changes: 9 additions & 1 deletion src/windows.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,12 @@ function GtkMessageDialog(parent::GtkContainerI, flags::Integer, typ::Integer,
w
end

#GtkSeparator — A separator widget
@gtktype GtkSeparator
GtkSeparator(vertical::Bool) =
GtkSeparator(
if vertical
ccall((:gtk_vseparator_new,libgtk),Ptr{GObject},())
else
ccall((:gtk_hseparator_new,libgtk),Ptr{GObject},())
end
)
2 changes: 2 additions & 0 deletions test/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ f = BoxLayout(:v)
w = Window(f, "Last in, first covered", 400, 400)

g1 = BoxLayout(:h)
hsep = Separator(:h)
g2 = BoxLayout(:h)
push!(f,g1)
push!(f,hsep)
push!(f,g2)

b11 = Button("first")
Expand Down