Skip to content

Commit

Permalink
Fix Linux Selectbox & Update Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
malisipi committed Feb 12, 2023
1 parent 427eab7 commit 62dda07
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion events.v
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn click_fn(x f32, y f32, mb gg.MouseButton, mut app &Window) {
app.native_focus = false
unsafe{
if app.focus!="" && app.active_dialog=="" {
if get_object_by_id(app, app.focus)["type"].str=="selectbox" && int(app.draw_mode) == 0 {
if get_object_by_id(app, app.focus)["type"].str=="selectbox" && $if windows { int(app.draw_mode)^1 == 0 } $else { true } {
mut old_focused_object:=get_object_by_id(app, app.focus)
app.focus=""
the_list := old_focused_object["list"].str.split("\0")
Expand Down
4 changes: 2 additions & 2 deletions examples/player.v
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ mut:
music ma.Sound
}

fn map_play_time(time int) string{
return (time/60).str()+":"+(time%60).str()
fn map_play_time(the_time int) string{
return (the_time/60).str()+":"+(the_time%60).str()
}

fn move_play_slider(mut app &mui.Window, mut app_data &AppData){
Expand Down
2 changes: 1 addition & 1 deletion examples/scrollable_widgets.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ user_list:=[
["Nathan","Drake", "28","Canada" ]
]

mut app:=m.create(title:"MUI", scrollbar:true, width:800, height: 600 view_area:[1000,1000], prefer_native:true)
mut app:=m.create(title:"MUI", scrollbar:true, width:800, height: 600 view_area:[1000,1000], draw_mode:.system_native)

app.textarea(id:"textarea", x:20, y:20, width:160, height:200, text:"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20")
app.scrollbar(id:"textarea_scrollbar", x:180, y:20, width: 15, height:200, vertical:true, connected_widget:app.get_object_by_id("textarea")[0])
Expand Down

0 comments on commit 62dda07

Please sign in to comment.